% core_1.m
%
% mfile to process core_1
% provides core specific information needed in processing as well as some
% basic metadata
%
% by Patrick Dickhudt - Jan. 2011  pdickhudt@usgs.gov
%
% filter and data file names
dfld = '/Users/Grace/Desktop/S5207'; % folder containing data file
ffld = '/Users/Grace/Desktop/S5207/TSS filters'; % folder containing filter file

filein = fullfile(dfld,'YR130822.txt');   % time series data file
filein2 = fullfile(ffld,'S5207filter.csv');  % filter data file

% Bottle switch times
day = '08/22/2013';
tstr{1}=[day ' 09:52:00'];
tstr{2}=[day ' 10:21:00'];
tstr{3}=[day ' 10:41:00'];
tstr{4}=[day ' 11:01:00'];
tstr{5}=[day ' 11:21:00'];
tstr{6}=[day ' 11:41:00'];
tstr{7}=[day ' 12:01:00'];


% make struct with core specific info

% the following need to be editted for each core
crinfo.ntun = 2;                    % turbidimeter number (1 or 2)
crinfo.rpmn = 2;                    % motor number (1 or 2)
crinfo.subsamp = 'n';               % were bottle samples subsamples 'y' or 'n'
crinfo.coren = 'S5207  core B';         % core number
crinfo.titlestr ='S5207 core B';       % for labelling plots - replace underscores with dashes etc. to improve appearance
crinfo.temp = 26.5;                   % water temp (C)
crinfo.lat = 37.34167;              % latitude
crinfo.lon = -76.62552;             % longitude
%crinfo.depth = ;                 % approximate depth (m)
crinfo.time  = '22-Aug-2013 07:55'; % core collection time
crinfo.corer = 'GOMEX corer with sub-core';% coring device
crinfo.vessel = 'R/V Gannet';     % coring platform
crinfo.op = 'K.Fall';     % operator
crinfo.timebase = 'CDT';            % time base

% note any relevant info, core description, etc.
crinfo.note = {'Turb to bottle tube length = 100 cm';
               'Nice core';
               %'nearly level surface';
               %'~ 4 mm surface relief';
               %'slightly hummocky surface';
               %'some worm tubes'
               };
           
% the following are general and likely apply to all cores for a given
% system
crinfo.system = {'VIMS'}; % erosion system used
crinfo.tube = 100;  % turbidimeter to bottle tube length (cm)
crinfo.tstr = tstr;
crinfo.nsteps=6;
crinfo.Aeff=0.0088382; %[m^2] effective area of sediment surface in core. - 4.5 inch OD tube (slow corer)
% crinfo.Aeff=0.0068337; %[m^2] effective area of sediment surface in core. - 4 inch OD tube (multicorer)

crinfo.fields = {'crinfo = core / system specific data';
                 'ntun = turbidimeter number (1 or 2)';
                 'rpmn = motor number (1 or 2)';
                 'subsamp = were bottle samples subsamples y or n (string)';
                 'coren = core number';
                 'titlestr = for labelling plots - replace underscores with dashes etc. to improve appearance';
                 'temp = water temp (C)';
                 'lat = latitude';
                 'lon = longitude';
                 'depth = approximate depth (m)';
                 'time = core collection time';
                 'corer = coring device';
                 'vessel = coring platform';
                 'op = operator';
                 'timebase = time base (GMT,EST, etc.)';
                 'note = relevant info, core description, etc.';
                 'system = erosion system used';
                 'tube = turbidimeter to bottle tube length (cm)';
                 'tstr = bottle switch times';
                 'nsteps = number of steps';
                 'Aeff = [m^2] effective area of sediment surface in core'};


[tsdat,stepdat,erdat,fitdat]=procerode3_VIMS(filein,filein2,crinfo);

close('all')


open([crinfo.coren '_er.fig'])
open(['M_' crinfo.coren '.fig'])
open(['tau_' crinfo.coren '.fig'])
